package com.woniuxy.project115.kaer.platform.controller;


import com.woniuxy.project115.kaer.commons.util.Result;
import com.woniuxy.project115.kaer.platform.annotation.RequireRole;
import com.woniuxy.project115.kaer.platform.service.AccountRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fyy
 * @since 2025年02月23日
 */
@RestController
@RequestMapping("/accountRole")
@Api(tags = "账户角色管理")
public class AccountRoleController {
    @Resource
    private AccountRoleService accountRoleService;

    //修改账号角色
    @PutMapping("/updateAccountRole")
    @ApiOperation("修改账号角色")
    @RequireRole("超级管理员")
    public Result updateAccountRole(Integer accountId, Integer roleId) throws Exception{
        accountRoleService.updateAccountRole(accountId, roleId);
        return Result.succeed("修改账号角色成功",null);
    }

}

